package com.archives.blog.common.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.archives.blog.common.config.ApplicationConfig;

public class ThymeleafLayoutInterceptor extends HandlerInterceptorAdapter{

	private static String IMAGE_URL = "imageUrl";

	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		if (modelAndView != null) {
		    modelAndView.addObject(IMAGE_URL, ApplicationConfig.uploadConfig.getImgUrl());
		}
	}

}
